#ifndef __SETTINGS_H
#define __SETTINGS_H

#include "User/Inc/ads1262/utils.h"
#include "User/Inc/gnss/utils.h"
#include "User/Inc/icm42688/utils.h"
#include "User/Inc/lsm6ds3/utils.h"
#include "User/Inc/types.h"
#include "Utils/Inc/gpio.h"

#define PACKET_SENDING_INTERVAL 100

static const mcu_utils_gpio_t BAUDRATE_SELECT_P1 = {
    .port = GPIOB,
    .pin = GPIO_PIN_8,
};
static const mcu_utils_gpio_t BAUDRATE_SELECT_P2 = {
    .port = GPIOB,
    .pin = GPIO_PIN_9,
};
static const mcu_utils_gpio_t SAMPLERATE_SELECT_P1 = {
    .port = GPIOB,
    .pin = GPIO_PIN_3,
};
static const mcu_utils_gpio_t SAMPLERATE_SELECT_P2 = {
    .port = GPIOB,
    .pin = GPIO_PIN_4,
};
static const mcu_utils_gpio_t OPTIONS_USE_ACCELEROMETER_PIN = {
    .port = GPIOB,
    .pin = GPIO_PIN_12,
};
static const mcu_utils_gpio_t OPTIONS_USE_GNSS_PIN = {
    .port = GPIOB,
    .pin = GPIO_PIN_11,
};
static const mcu_utils_gpio_t OPTIONS_CHANNEL_6D_PIN = {
    .port = GPIOB,
    .pin = GPIO_PIN_10,
};
static const mcu_utils_gpio_t EEPROM_WP_PIN = {
    .port = GPIOB,
    .pin = GPIO_PIN_5,
};
static const mcu_utils_gpio_t MCU_BOOT1_PIN = {
    .port = GPIOB,
    .pin = GPIO_PIN_2,
};
static const mcu_utils_gpio_t MCU_STATE_PIN = {
    .port = GPIOC,
    .pin = GPIO_PIN_13,
};
static const gnss_ctl_pin_t GNSS_CTL_PIN = {
    .pps = {.port = GPIOA, .pin = GPIO_PIN_8},
    .rst = {.port = GPIOA, .pin = GPIO_PIN_15},
};
#if DEVICE_MODEL == E_C111G
static const lsm6ds3_ints_pin_t LSM6DS3_INTS_PIN = {
    .int_1 = {.port = GPIOB, .pin = GPIO_PIN_0},
    .int_2 = {.port = GPIOB, .pin = GPIO_PIN_1},
};
#elif DEVICE_MODEL == E_C121G
static const icm42688_ints_pin_t ICM42688_INTS_PIN = {
    .int_1 = {.port = GPIOB, .pin = GPIO_PIN_1},
    .int_2 = {.port = GPIOB, .pin = GPIO_PIN_0},
};
#endif
static const ads1262_ctl_pin_t ADS1262_CTL_PIN = {
    .start = {.port = GPIOA, .pin = GPIO_PIN_12},
    .drdy = {.port = GPIOA, .pin = GPIO_PIN_11},
    .rst = {.port = GPIOA, .pin = GPIO_PIN_1},
};

static const uint8_t ANYSHAKE_LOGO_BITMAP_RLE[] = {
    255, 0x00,
    255, 0x00,
    12, 0x00,
    1, 0xE0,
    2, 0xF0,
    1, 0xE0,
    2, 0x00,
    2, 0x80,
    12, 0x00,
    1, 0xFE,
    2, 0xFF,
    1, 0xFE,
    1, 0x00,
    1, 0xE0,
    2, 0xF0,
    1, 0xE0,
    15, 0x00,
    1, 0x0C,
    1, 0xEC,
    1, 0xFC,
    1, 0xBC,
    1, 0xFC,
    1, 0xF8,
    1, 0xC0,
    2, 0x00,
    1, 0x30,
    2, 0xF0,
    1, 0x70,
    1, 0x30,
    1, 0x70,
    1, 0xF0,
    1, 0xE0,
    1, 0x00,
    1, 0x30,
    2, 0xF0,
    1, 0xB0,
    1, 0x00,
    1, 0xB0,
    2, 0xF0,
    1, 0x30,
    1, 0x00,
    1, 0x38,
    1, 0x7C,
    1, 0xFC,
    2, 0xCC,
    2, 0xDC,
    1, 0x98,
    1, 0x00,
    1, 0x06,
    2, 0xFE,
    3, 0x30,
    1, 0xF0,
    1, 0xE0,
    2, 0x00,
    1, 0xA0,
    4, 0xB0,
    1, 0xF0,
    1, 0xE0,
    1, 0x00,
    1, 0x04,
    1, 0x0E,
    2, 0xFE,
    1, 0xE0,
    1, 0xF0,
    1, 0x70,
    2, 0x30,
    1, 0x00,
    1, 0xC0,
    1, 0xE0,
    1, 0xF0,
    2, 0xB0,
    1, 0xF0,
    1, 0xE0,
    1, 0xC0,
    1, 0x00,
    1, 0xC0,
    2, 0xE0,
    1, 0xC0,
    1, 0x00,
    1, 0xFC,
    2, 0xFE,
    1, 0xFC,
    1, 0x00,
    4, 0xFF,
    1, 0x00,
    4, 0xFF,
    1, 0x00,
    1, 0xF0,
    2, 0xF8,
    1, 0xF0,
    1, 0x00,
    1, 0xFE,
    2, 0xFF,
    1, 0xFE,
    1, 0x00,
    4, 0xFF,
    1, 0x00,
    4, 0xFF,
    1, 0x00,
    1, 0xFE,
    2, 0xFF,
    1, 0xFE,
    1, 0x00,
    1, 0xE0,
    2, 0xF0,
    1, 0xE0,
    4, 0x00,
    1, 0x0C,
    2, 0x0F,
    1, 0x0D,
    2, 0x01,
    3, 0x0F,
    2, 0x0C,
    2, 0x0F,
    1, 0x0C,
    1, 0x00,
    1, 0x0C,
    2, 0x0F,
    1, 0x0C,
    2, 0x60,
    1, 0x63,
    1, 0x7F,
    1, 0x7E,
    1, 0x6F,
    1, 0x03,
    3, 0x00,
    1, 0x07,
    1, 0x0F,
    1, 0x0E,
    2, 0x0C,
    1, 0x0E,
    2, 0x07,
    1, 0x00,
    1, 0x0C,
    2, 0x0F,
    1, 0x0C,
    1, 0x00,
    1, 0x0E,
    2, 0x0F,
    1, 0x0C,
    1, 0x03,
    1, 0x07,
    1, 0x0F,
    3, 0x0D,
    2, 0x0F,
    1, 0x0C,
    1, 0x04,
    1, 0x0E,
    2, 0x0F,
    1, 0x01,
    2, 0x0F,
    2, 0x0E,
    1, 0x00,
    1, 0x03,
    1, 0x07,
    1, 0x0F,
    4, 0x0D,
    1, 0x01,
    1, 0x00,
    1, 0x01,
    2, 0x03,
    1, 0x01,
    1, 0x00,
    1, 0x0F,
    2, 0x1F,
    1, 0x0F,
    1, 0x00,
    4, 0xFF,
    1, 0x00,
    1, 0x7F,
    2, 0xFF,
    1, 0x7F,
    1, 0x00,
    1, 0x03,
    2, 0x07,
    1, 0x03,
    1, 0x00,
    1, 0x1F,
    2, 0x3F,
    1, 0x1F,
    1, 0x00,
    4, 0xFF,
    1, 0x00,
    4, 0xFF,
    1, 0x00,
    1, 0x1F,
    2, 0x3F,
    1, 0x1F,
    2, 0x00,
    2, 0x01,
    5, 0x00,
    1, 0x0C,
    3, 0xFC,
    1, 0xEC,
    1, 0xFC,
    1, 0x0C,
    2, 0xBC,
    1, 0x00,
    1, 0x30,
    1, 0x70,
    2, 0xF0,
    1, 0xC0,
    1, 0xF0,
    1, 0x70,
    1, 0x30,
    1, 0x00,
    1, 0x30,
    2, 0xF0,
    4, 0x30,
    1, 0xF0,
    1, 0xE0,
    2, 0x00,
    2, 0x06,
    2, 0xFE,
    4, 0x00,
    1, 0xE0,
    1, 0xF0,
    1, 0x30,
    2, 0x38,
    1, 0x30,
    1, 0xF0,
    1, 0xE0,
    2, 0x00,
    1, 0x30,
    3, 0xF0,
    3, 0x30,
    1, 0x20,
    1, 0x00,
    1, 0xE0,
    1, 0xF0,
    1, 0xF8,
    2, 0xD8,
    1, 0xF8,
    1, 0xF0,
    1, 0xE0,
    1, 0x00,
    2, 0x30,
    3, 0xF0,
    2, 0x30,
    1, 0x20,
    11, 0x00,
    1, 0x03,
    2, 0x07,
    1, 0x03,
    16, 0x00,
    1, 0x1F,
    2, 0x3F,
    1, 0x1F,
    2, 0x00,
    2, 0x01,
    15, 0x00,
    1, 0x06,
    3, 0x07,
    1, 0x06,
    1, 0x07,
    1, 0x06,
    2, 0x07,
    1, 0x00,
    1, 0x06,
    3, 0x07,
    1, 0x01,
    2, 0x07,
    1, 0x06,
    1, 0x04,
    1, 0x30,
    2, 0x3F,
    2, 0x36,
    2, 0x06,
    1, 0x07,
    1, 0x03,
    1, 0x00,
    3, 0x06,
    2, 0x07,
    3, 0x06,
    1, 0x00,
    1, 0x03,
    1, 0x07,
    1, 0x06,
    2, 0x0E,
    1, 0x06,
    1, 0x07,
    1, 0x03,
    1, 0x00,
    2, 0x06,
    3, 0x07,
    3, 0x06,
    2, 0x00,
    1, 0x01,
    1, 0x03,
    1, 0x07,
    4, 0x06,
    2, 0x00,
    2, 0x06,
    3, 0x07,
    2, 0x06,
    2, 0x00};

#endif
